﻿Imports System.Web
Imports System.Web.Security

Partial Public Class frmLogin
    Dim numberOfTries As Integer
    Dim passwordRetries As Integer = 0

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        DialogResult = False
        Application.Current.Shutdown()
    End Sub

    Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        

        Try
            If Not Membership.ValidateUser(txtUserName.Text, txtPassword.Password) Then

                MessageBox.Show("Unable to authenticate.", "Not logged in", _
                     MessageBoxButton.OK, MessageBoxImage.Error)


            End If


            'If True Then
            '    DialogResult = True
            '    ATSMainStandAlone.v_username = txtUserName.Text
            '    Me.Close()
            'Else
            '    MsgBox("Only members of the Administrator or Synch Reader groups are allowed to use this function.", MsgBoxStyle.Information, "User not allowed")
            'End If
        Catch ex As Exception
            MsgBox("Please check your username and password.", MsgBoxStyle.Exclamation, "Invalid login")
        End Try
    End Sub



    'Public Function GetCredentials() As ClientFormsAuthenticationCredentials Implements IClientFormsAuthenticationCredentialsProvider.GetCredentials

    '    If Me.ShowDialog() = DialogResult.OK Then
    '        Return New ClientFormsAuthenticationCredentials( _
    '            UsernameTextBox.Text, PasswordTextBox.Text, _
    '            rememberMeCheckBox.Checked)
    '    Else
    '        Return Nothing
    '    End If

    'End Function

End Class